
package com.ives.launcher.model;

import android.content.ComponentName;
import android.content.Intent;
import android.graphics.drawable.Drawable;

/**
 * 普通应用程序model
 */
public class ItemInfo_App extends ItemInfo{


	/**
	 * 用来启动的intent
	 */
	public Intent intent;

	


	public boolean filtered;
	/**
	 * 是否自定义icon
	 */
	public boolean customIcon;


	public ItemInfo_App() {
		
	}

	public ItemInfo_App(ItemInfo_App info) {
		super(info);
		title = info.title.toString();
		intent = new Intent(info.intent);
		icon = info.icon;
		filtered = info.filtered;
		customIcon = info.customIcon;
		this.itemType=info.itemType;
	}

	/**
	 * Creates the application intent based on a component name and various
	 * launch flags. Sets {@link #itemType} to
	 * {@link LauncherSettings.BaseLauncherColumns#ITEM_TYPE_APPLICATION}.
	 * 
	 * @param className
	 *            the class name of the component representing the intent
	 * @param launchFlags
	 *            the launch flags
	 */
	public final void setActivity(ComponentName className, int launchFlags) {
		intent = new Intent(Intent.ACTION_MAIN);
		intent.addCategory(Intent.CATEGORY_LAUNCHER);
		intent.setComponent(className);
		intent.setFlags(launchFlags);
		
	}


	@Override
	public String toString() {
		return title.toString();
	}
}
